//
//  GiftView.m
//  TEst
//
//  Created by   丛熠超 on 2017/4/13.
//  Copyright © 2017年 Tongcheng. All rights reserved.
//

#import "GiftView.h"

@implementation GiftView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = [UIColor clearColor];
    
    [self.GiftCollectionView registerNib:[UINib nibWithNibName:@"GiftCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"cell"];
    self.GiftCollectionView.delegate = self;
    self.GiftCollectionView.dataSource = self;
    self.GiftCollectionView.backgroundColor = [UIColor lightGrayColor];
    self.GiftCollectionView.bounces = NO;
    self.GiftCollectionView.showsVerticalScrollIndicator = NO;
    self.GiftCollectionView.showsHorizontalScrollIndicator = NO;
    UIGestureRecognizer *ges = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(desdory)];
    [self.BackView addGestureRecognizer:ges];
//    [self addSubview:self.GiftCollectionView];
}

+ (instancetype)gainMineHeaderView
{
    return [[NSBundle mainBundle] loadNibNamed:@"GiftView" owner:self options:nil].lastObject;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    
    return 29;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
    return cell;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    
    return CGSizeMake(90, 74);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
    return 1;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
    return 1;
}
- (IBAction)Send:(UIButton *)sender {
}
- (IBAction)charge:(UIButton *)sender {
}

- (void)desdory {
    if ([_delegate respondsToSelector:@selector(removeGiftView)]) {
        [_delegate removeGiftView];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
